// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App.vue'
import store2 from 'store2'
import store from './store'
import router from './router'
import VueLazyload from 'vue-lazyload'
import { sync } from 'vuex-router-sync'
import * as filters from './filters'

Vue.config.productionTip = false

Vue.use(VueLazyload, {
  preLoad: 1.3,
  attempt: 1
})
// sync the router with the vuex store.
// this registers `store.state.route`
sync(store, router)
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

store2('firsEnterUrl', window.location.href.split('#')[0]);
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  data () {
    return {
      eventHub: new Vue()
    }
  },
  template: '<App/>',
  components: { App }
})
